<?php if(empty($obras)) : ?>
    <?php echo $this->Html->image('icon_pers/home.png'); ?>
    <?php echo $this->Html->link('Home',(array('controller'=>'usuarios','action'=>'admin'))); ?>
    <fieldset><legend> No hay obras </fieldset> </legend>
    <?php echo $this->Html->link('Añadir obras',(array('action'=>'add'))); ?>

    
<?php else: ?>
    <?php echo $this->Html->image('icon_pers/home.png'); ?>
    <?php echo $this->Html->link('Home',(array('controller'=>'usuarios','action'=>'admin'))); ?>
    <fieldset><legend> Obras </fieldset> </legend>
    <table>
        <tr>
            <th>Nombre</th>
            <th>Descripcion</th>
            <th>Dirección</th>
        </tr>
    
        <?php foreach ($obras as $work): ?>
        <tr>
            <?php echo $this->Html->charset('UTF-8'); ?>
            <td><?php echo $work['Obra']['nombre']; ?></td>
            <td><?php echo $work['Obra']['descripcion']; ?></td>
            <td><?php echo $work['Obra']['direccion']; ?></td>
        

        
        <td><?php 
        echo $this->Html->image('icon_pers/edit.png');
        echo $this->Html->link(   'Editar',
                                            array('action'=>'edit',$work['Obra']['id']),  
                                            array(),
                                            "¿Esta seguro que desea modificar este registro?"
                                        );
            ?></td>
        <td><?php 
        echo $this->Html->image('icon_BOD/borrar.png');
        echo $this->Html->link(   'Eliminar',
                                            array('action'=>'delete',$work['Obra']['id']),  
                                            array(),
                                            "¿Esta seguro que desea eliminar este registro?"
                                        );
            ?></td>
    </tr>
    <?php endforeach; ?>
</table>
<?php echo $this->Html->image('icon_prod/obra.png'); ?>
<?php echo $this->Html->link('Añadir Obra ',(array('action'=>'add'))); ?>

<br>

<?php echo $this->Html->image('icon_pers/home.png'); ?>
<?php echo $this->Html->link('Home',(array('controller'=>'usuarios','action'=>'admin'))); ?>
<?php endif; ?>